import 'package:firebase_performance/firebase_performance.dart';

class TraceWrapper {
  final Trace? _trace;
  TraceWrapper(this._trace);

  Future<void> start() {
    return _trace?.start() ?? Future.value();
  }

  Future<void> stop() {
    return _trace?.stop() ?? Future.value();
  }

  void putAttribute(String name, String value) {
    _trace?.putAttribute(name, value);
  }

  void incrementMetric(String name, int value) {
    _trace?.incrementMetric(name, value);
  }
}